import logging
import os

def settinglog():
    logging.basicConfig(
        filename=os.path.join('logs', 'app.log'),
        level=logging.INFO,
        format='%(asctime)s - %(levelname)s - %(message)s'
    )

settinglog()#main导入时自动初始化